package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.domain.entity.ServiceType;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.system.mapper.ServiceTypeMapper;
import com.ruoyi.system.service.IServiceTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ServiceTypeServiceImpl implements IServiceTypeService {

    @Autowired
    private ServiceTypeMapper serviceTypeMapper;

    @Override
    public List<ServiceType> selectServiceTypeList(ServiceType serviceType) {
        return serviceTypeMapper.selectServiceTypeList(serviceType);
    }

    @Override
    public ServiceType selectServiceTypeById(Long id) {
        return serviceTypeMapper.selectServiceTypeById(id);
    }

    @Override
    public int insertServiceType(ServiceType serviceType) {
        return serviceTypeMapper.insertServiceType(serviceType);
    }

    @Override
    public int updateServiceType(ServiceType serviceType) {
        return serviceTypeMapper.updateServiceType(serviceType);
    }

    @Override
    public int deleteServiceTypeById(Long id) {
        return serviceTypeMapper.deleteServiceTypeById(id);
    }

    @Override
    public int deleteServiceTypeByIds(Long[] ids) {
        return serviceTypeMapper.deleteServiceTypeByIds(ids);
    }

    @Override
    public int deleteServiceTypeByIds(String ids) {
        return serviceTypeMapper.deleteServiceTypeByIds(Convert.toLongArray(ids));
    }
    @Override
    public boolean existsById(Long id) {
        return serviceTypeMapper.countById(id) > 0;
    }
}